<template>
  <el-form ref="form" :model="form" label-width="40px">
    <el-form-item label="颜色">
      <el-color-picker v-model="form.c" />
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'UIBackground',
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  data () {
		const bg = this.value
    return {
      form: Object.assign({}, this.value)
    }
  },
  watch: {
    form: {
      handler (val, oldVal) {
        this.$emit('change', {
          key: 'bg',
          value: val
        })
      },
      deep: true
    },
		value(new_val,old_val){
			// console.log(new_val)
			this.form.c=new_val.c
		}
  }
}
</script>
